package gouhuo.allbugs.top.common;

/**
 * 自定义异常类
 *
 * @author 15294780204
 */
public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 5499867658247039656L;

    private int code;

    private final String description;


    public BusinessException(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.description = errorCode.getMessage();
    }

    public BusinessException(ErrorCode errorCode, String description) {
        this.code = errorCode.getCode();
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public int getCode() {
        return code;
    }
}